# coding: utf-8
# @Author: cyl
# @File: del_pycache.py
# @Time: 2024/09/25 22:13:16
import os
import shutil
 

def purge_cache(path: str):
    for file_name in os.listdir(path):
        abs_path = os.path.join(path, file_name)
        if file_name == "__pycache__":
            print("del pycache: ", abs_path)
            shutil.rmtree(abs_path)
        elif os.path.isdir(abs_path):
            purge_cache(abs_path)
 

if __name__ == "__main__":
    basic_dir: str = os.path.dirname(os.path.abspath(__file__))
    purge_cache(basic_dir)
